[codex] Structure mobile cloud-link failures#3320
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR refactors error handling to use structured error types and redacts URL secrets from error diagnostics - a security improvement. The core cloud-linking business logic is unchanged; only error construction and formatting changes. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate fb67183
fb67183 to
21bfa07
Compare
Dismissing prior approval to re-evaluate 21bfa07
b87e64a to
3167aeb
Compare
Dismissing prior approval to re-evaluate 9a2733c
6eba786 to
aacb560
Compare
9a2733c to
e9c868a
Compare
Dismissing prior approval to re-evaluate e9c868a
aacb560 to
77e5b36
Compare
e9c868a to
8163b74
Compare
77e5b36 to
6bc2561
Compare
b954b21 to
296e9bb
Compare
6bc2561 to
71f9ff5
Compare
296e9bb to
adaf66f
Compare
71f9ff5 to
8bc20f2
Compare
adaf66f to
0fcf0f4
Compare
8bc20f2 to
3f67e2b
Compare
49b97b4 to
9b6ce56
Compare
70fdb85 to
5a80908
Compare
553daf6 to
ed36096
Compare
2a031a9 to
b63cfb3
Compare
ed36096 to
15aa01a
Compare
b63cfb3 to
eadf056
Compare
bd937be to
517c1ea
Compare
1830060 to
534fad3
Compare
8d916bc to
7670d78
Compare
534fad3 to
6601ea3
Compare
7670d78 to
1ed6271
Compare
6601ea3 to
6c8a6b1
Compare
Dismissing prior approval to re-evaluate 6c8a6b1
c91fad6 to
9e0c536
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
6c8a6b1 to
d0671a3
Compare
a7d56b3
into
codex/redact-dpop-request-target
Summary
Validation
vp test run apps/mobile/src/features/cloud/linkEnvironment.test.ts(21 tests)vp run lint:mobilevp check(passes with 20 pre-existing warnings)vp run typecheckOverlap
Note
Medium Risk
Error
_tagvalues and user-visible messages change across link/list/connect/status flows; UI or logging that matched old URL-embedded strings or a singleCloudEnvironmentLinkErrortag needs updating.Overview
Replaces the single
CloudEnvironmentLinkErrorbucket in mobile cloud linking with aSchema.Unionof tagged errors and removes URL-heavy, dev-only, and relay-string message builders.CloudEnvironmentLinkOperationErrornow records anaction, optionalenvironmentId, redacted URL diagnostics viagetUrlDiagnostics(length/protocol/hostname only), nestedrelayError/environmentError, andtraceId, with stable user-facing messages likeCould not {action} for environment "{id}".Mismatch cases use dedicated types (CloudEnvironmentIdMismatchError,CloudEnvironmentEndpointMismatchError,CloudEnvironmentEndpointProviderMismatchError,CloudEnvironmentLocalBearerRequiredError,CloudRelayUrlNotConfiguredError) with expected/actual fields instead of generic strings.Synchronous throws for URL parsing and HTTP client setup are routed through
Effect.tryinto operation errors. Per-environmentstatusErrorstrings now come from these typedmessagegetters. Tests assert secret redaction in serialization and updated_tag/ field shapes;isCloudEnvironmentLinkErrornarrows the union.Reviewed by Cursor Bugbot for commit d0671a3. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Replace generic cloud link errors with structured, action-specific error types in mobile
linkEnvironment.ts:CloudEnvironmentLinkOperationError,CloudRelayUrlNotConfiguredError,CloudEnvironmentLocalBearerRequiredError,CloudEnvironmentIdMismatchError,CloudEnvironmentEndpointMismatchError, andCloudEnvironmentEndpointProviderMismatchError.CloudEnvironmentLinkErrorunion type andisCloudEnvironmentLinkErrorguard so callers can reliably discriminate all link-related failures.linkEnvironmentToCloud,connectRelayManagedEnvironment,listCloudEnvironments, andgetCloudEnvironmentStatusnow emits a different_tagand message format than before; callers matching on previous error shapes will need updating.Macroscope summarized d0671a3.